Optimal. Leaf size=160 \[ \frac{\left (5 a^2 A-2 a b B-A b^2\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{\sec ^4(c+d x) \left (\left (5 a^2 A-2 a b B+3 A b^2\right ) \sin (c+d x)+2 b (4 a A-b B)\right )}{24 d}+\frac{\left (5 a^2 A-2 a b B-A b^2\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac{\sec ^6(c+d x) (a+b \sin (c+d x))^2 (A \sin (c+d x)+B)}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.205196, antiderivative size = 160, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.161, Rules used = {2837, 821, 778, 199, 206} \[ \frac{\left (5 a^2 A-2 a b B-A b^2\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{\sec ^4(c+d x) \left (\left (5 a^2 A-2 a b B+3 A b^2\right ) \sin (c+d x)+2 b (4 a A-b B)\right )}{24 d}+\frac{\left (5 a^2 A-2 a b B-A b^2\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac{\sec ^6(c+d x) (a+b \sin (c+d x))^2 (A \sin (c+d x)+B)}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2837
Rule 821
Rule 778
Rule 199
Rule 206
Rubi steps
\begin{align*} \int \sec ^7(c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac{b^7 \operatorname{Subst}\left (\int \frac{(a+x)^2 \left (A+\frac{B x}{b}\right )}{\left (b^2-x^2\right )^4} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac{\sec ^6(c+d x) (B+A \sin (c+d x)) (a+b \sin (c+d x))^2}{6 d}-\frac{b^5 \operatorname{Subst}\left (\int \frac{(a+x) (-5 a A+2 b B-3 A x)}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{6 d}\\ &=\frac{\sec ^6(c+d x) (B+A \sin (c+d x)) (a+b \sin (c+d x))^2}{6 d}+\frac{\sec ^4(c+d x) \left (2 b (4 a A-b B)+\left (5 a^2 A+3 A b^2-2 a b B\right ) \sin (c+d x)\right )}{24 d}+\frac{\left (b^3 \left (5 a^2 A-A b^2-2 a b B\right )\right ) \operatorname{Subst}\left (\int \frac{1}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{8 d}\\ &=\frac{\sec ^6(c+d x) (B+A \sin (c+d x)) (a+b \sin (c+d x))^2}{6 d}+\frac{\sec ^4(c+d x) \left (2 b (4 a A-b B)+\left (5 a^2 A+3 A b^2-2 a b B\right ) \sin (c+d x)\right )}{24 d}+\frac{\left (5 a^2 A-A b^2-2 a b B\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac{\left (b \left (5 a^2 A-A b^2-2 a b B\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{16 d}\\ &=\frac{\left (5 a^2 A-A b^2-2 a b B\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{\sec ^6(c+d x) (B+A \sin (c+d x)) (a+b \sin (c+d x))^2}{6 d}+\frac{\sec ^4(c+d x) \left (2 b (4 a A-b B)+\left (5 a^2 A+3 A b^2-2 a b B\right ) \sin (c+d x)\right )}{24 d}+\frac{\left (5 a^2 A-A b^2-2 a b B\right ) \sec (c+d x) \tan (c+d x)}{16 d}\\ \end{align*}
Mathematica [A] time = 1.48697, size = 242, normalized size = 1.51 \[ \frac{-\frac{3 b \left (-5 a^2 A+2 a b B+A b^2\right ) \left (\left (4 a b^3-6 a^3 b\right ) \tan ^2(c+d x)+\left (a^2-b^2\right )^2 (\log (1-\sin (c+d x))-\log (\sin (c+d x)+1))-2 \left (a^4-b^4\right ) \tan (c+d x) \sec (c+d x)+2 a^3 b \sec ^2(c+d x)\right )}{16 (a-b) (a+b)}+b \sec ^6(c+d x) (a+b \sin (c+d x))^3 ((b B-a A) \sin (c+d x)-a B+A b)+\frac{1}{4} b \sec ^4(c+d x) (a+b \sin (c+d x))^3 ((2 b B-5 a A) \sin (c+d x)+3 A b)}{6 b d \left (b^2-a^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.097, size = 396, normalized size = 2.5 \begin{align*}{\frac{{a}^{2}A\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{5}}{6\,d}}+{\frac{5\,{a}^{2}A\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{24\,d}}+{\frac{5\,{a}^{2}A\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{16\,d}}+{\frac{5\,{a}^{2}A\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{16\,d}}+{\frac{B{a}^{2}}{6\,d \left ( \cos \left ( dx+c \right ) \right ) ^{6}}}+{\frac{Aab}{3\,d \left ( \cos \left ( dx+c \right ) \right ) ^{6}}}+{\frac{Bab \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3\,d \left ( \cos \left ( dx+c \right ) \right ) ^{6}}}+{\frac{Bab \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{Bab \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{8\,d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}+{\frac{Bab\sin \left ( dx+c \right ) }{8\,d}}-{\frac{Bab\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{A{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{6\,d \left ( \cos \left ( dx+c \right ) \right ) ^{6}}}+{\frac{A{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{8\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{A{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{16\,d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}+{\frac{A{b}^{2}\sin \left ( dx+c \right ) }{16\,d}}-{\frac{A{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{16\,d}}+{\frac{B{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{6\,d \left ( \cos \left ( dx+c \right ) \right ) ^{6}}}+{\frac{B{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{12\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.02698, size = 285, normalized size = 1.78 \begin{align*} \frac{3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac{2 \,{\left (3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{5} + 12 \, B b^{2} \sin \left (d x + c\right )^{2} - 8 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{3} + 8 \, B a^{2} + 16 \, A a b - 4 \, B b^{2} + 3 \,{\left (11 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1}}{96 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.56532, size = 493, normalized size = 3.08 \begin{align*} \frac{3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 24 \, B b^{2} \cos \left (d x + c\right )^{2} + 16 \, B a^{2} + 32 \, A a b + 16 \, B b^{2} + 2 \,{\left (3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \cos \left (d x + c\right )^{4} + 8 \, A a^{2} + 16 \, B a b + 8 \, A b^{2} + 2 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{96 \, d \cos \left (d x + c\right )^{6}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.4389, size = 309, normalized size = 1.93 \begin{align*} \frac{3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - 3 \,{\left (5 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (15 \, A a^{2} \sin \left (d x + c\right )^{5} - 6 \, B a b \sin \left (d x + c\right )^{5} - 3 \, A b^{2} \sin \left (d x + c\right )^{5} - 40 \, A a^{2} \sin \left (d x + c\right )^{3} + 16 \, B a b \sin \left (d x + c\right )^{3} + 8 \, A b^{2} \sin \left (d x + c\right )^{3} + 12 \, B b^{2} \sin \left (d x + c\right )^{2} + 33 \, A a^{2} \sin \left (d x + c\right ) + 6 \, B a b \sin \left (d x + c\right ) + 3 \, A b^{2} \sin \left (d x + c\right ) + 8 \, B a^{2} + 16 \, A a b - 4 \, B b^{2}\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{3}}}{96 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]